package unit.entity;

import static org.junit.Assert.*;

import java.util.Date;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import am.bll.entity.AccountBook;
import am.bll.entity.basic.Money;

public class AccountBookTester
{

    @Before
    public void setUp() throws Exception
    {
    }

    @After
    public void tearDown() throws Exception
    {
    }

    @Test
    public void testConstructor()
    {
        // 无关测试
        assertEquals(new Date(2012, 1, 3), new Date(2012, 1, 3));

        // case 01: 一般
        AccountBook ab01 = new AccountBook();
        ab01.setID(10);
        ab01.setCreateTime(new Date(2011, 11, 11));
        ab01.setLastEditTime(new Date(2022, 12, 12));
        ab01.setName("中文abc");
        ab01.setTotal(new Money("945.234"));

        assertEquals(10, ab01.getID());
        assertEquals(new Date(2011, 11, 11), ab01.getCreateTime());
        assertEquals(new Date(2022, 12, 12), ab01.getLastEditTime());
        assertEquals("中文abc", ab01.getName());
        assertEquals("945.2340", ab01.getTotal().toString());
    }
}